﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace xna_game_engine.source
{
    public class FireWizard : BaseWizard
    {
        public FireWizard(PlayerIndex player) : base()
        {
            mName = "Fire Wizard "+player;
            mSpeed = 5;
            mFrameImage = GameGlobals.Content.Load<Texture2D>("sprites\\unit_frames\\player_image");
            mModel = GameGlobals.Content.Load<Texture2D>("sprites\\unit_frames\\player_image");
            MapSpell(new StaffSpell(this, "sprites\\spells\\firebolt"), FaceButtons.R_TRIGGER);
            MapSpell(new DeathSpell(this, "sprites\\spells\\deathbolt"), FaceButtons.B_BUTTON);
            MapSpell(new ReflectSpell(this, "sprites\\spells\\reflect"), FaceButtons.Y_BUTTON);
            mBoundingBox = new Rectangle((int)mPos.X, (int)mPos.Y, mModel.Width, mModel.Height);
            playerIndex = player;
        }

        public override void Update(GameTime gt)
        {
            UpdatePosition();
        }

        // Private Helpers
        private void UpdatePosition()
        {
            mPos.X += mSpeed * (GamePad.GetState(playerIndex).ThumbSticks.Left.X);
            mPos.Y += mSpeed * -(GamePad.GetState(playerIndex).ThumbSticks.Left.Y);
            mBoundingBox.Location = new Point((int)mPos.X, (int)mPos.Y);
        }
    }
}
